const app=Vue.createApp({
    data(){
        return{
            img:{src:'img/bannerleft.jpg'},
            header:[
                {
                    pic:{src:'img/logo-mi2.png'},
                    title:'小米账号'
                }
            ],
            //导航信息
            titleList:[
                {title:'用户协议',url:'#'},
                {title:'隐私政策',url:'#'},
                {title:'帮助中心',url:'#'},
                {title:'中文（简体）',url:'#',show:false,subMenu:[{title:'中文(繁體)',url:'#'},{title:'English',url:'#'}]}
            ],
            //用户信息
            user:{
                tel:'',
                password:'',
                selCityId:'',
            },
            //城市信息
            citys:[
                {id:01,name:'中国'},
                {id:02,name:'蒙古'},
                {id:03,name:'朝鲜'},
                {id:04,name:'马尔代夫'},
                {id:05,name:'马来西亚'},
                {id:06,name:'尼泊尔'},
                {id:07,name:'挪威'},
                {id:08,name:'新西兰'},
                {id:09,name:'洪都拉斯'},
                {id:10,name:'巴布亚新几内亚'},
            ],
            loginshow:true,//展示登录
            regshow:false,//展示注册
            zh:false,//账号
            passw:false,//密码
            phone:false//电话
        }
    },
    methods:{
        //输入账号
        account(e){
            if(e.target.value == ''){
                this.zh = true;
            }else{
                this.zh = false;
            }
        },
        //输入密码
        pwd(e){
            if(e.target.value == ''){
                this.passw = true;
            }else{
                this.passw = false;
            }
        },
        //输入手机号
        telPhone(e){
            if(e.target.value == ''){
                this.phone = true;
            }else{
                this.phone = false;
            }
        },
        //登录
        login(){
            this.loginshow=true,
            this.regshow=false
        },
        //注册
        enroll(){
            this.loginshow=false,
            this.regshow=true
        },
        //获取验证码
        gCode(){
            alert("验证码已发送");
        }
        
    }
});
const vm=app.mount("#root");